package mapEditor.view.resItemEdit
{
	import flash.display.Sprite;
	import flash.events.Event;
	
	import utils.DisplayUtil;

	public class ItemPropertyPanelView extends Sprite
	{
		private var _itemPropertyView:ItemPropertyView;
		private var _itemPropertyAssetView:ItemPropertyAssetView;
		
		public function ItemPropertyPanelView()
		{
			_itemPropertyView=new ItemPropertyView();
			_itemPropertyView.addEventListener(Event.CHANGE, __onItemPropertyChange);
			addChild(_itemPropertyView);
			
			_itemPropertyAssetView=new ItemPropertyAssetView();
			_itemPropertyAssetView.y=_itemPropertyView.height+5;
			addChild(_itemPropertyAssetView);
		}
		
		private function __onItemPropertyChange(evt:Event):void
		{
			_itemPropertyAssetView.y=_itemPropertyView.height+5;
		}
		
		public function dispose():void
		{
			if(_itemPropertyView)
			{
				_itemPropertyView.removeEventListener(Event.CHANGE, __onItemPropertyChange);
				DisplayUtil.dispose(_itemPropertyView);
				_itemPropertyView=null;
			}
			DisplayUtil.dispose(_itemPropertyAssetView);
			_itemPropertyAssetView=null;
			if(parent)parent.removeChild(this);
		}
	}
}